package com.bb.blog.activiti.config.listener;

import lombok.AllArgsConstructor;
import org.activiti.bpmn.model.ActivitiListener;
import org.activiti.engine.TaskService;
import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;
import org.springframework.stereotype.Component;

@Component
@AllArgsConstructor
public class MyTaskListener extends ActivitiListener implements TaskListener {
    private final TaskService taskService;

    @Override
    public void notify(DelegateTask delegateTask) {

        System.out.println("============  TaskListener start  ============");
        String taskDefinitionKey = delegateTask.getTaskDefinitionKey();
        String eventName = delegateTask.getEventName();

        System.out.println("事件名称:" + eventName);
        System.out.println("taskDefinitionKey:" + taskDefinitionKey);
        System.out.println("============TaskListener end ============");

    }
}
